package top.infopub.util;


import org.apache.commons.lang3.RandomStringUtils;


/**
 * 随机echo生成工具类
 * @author Awoke
 * @version 2014-7-15
 * @see RandomEchoUtil
 * @since
 */
public class RandomEchoUtil {

    /**
     * 随机字符串生成池（只有大写）
     */
    public static final StringBuilder CHARS_POOL_U = new StringBuilder(
        "ABCDEFGHIJKLMNOPQRSTUVWXYZ");

    /**
     * 随机字符串生成池（只有小写）
     */
    public static final StringBuilder CHARS_POOL_L = new StringBuilder(
        "abcdefghijklmnopqrstuvwxyz");

    /**
     * 随机字符串生成池（只有数字）
     */
    public static final StringBuilder CHARS_POOL_N = new StringBuilder("0123456789");

    /**
     * 随机字符串生成池（特殊字符）
     */
    public static final StringBuilder CHARS_POOL_S = new StringBuilder("-_");

    /**
     * 生成echoStr
     * @param echoLength 长度
     * @param StringBuffer 随机字符串生成池，根据_U,_L,_N,_S自由组合
     * @return 
     * @see
     */
    public static String echoStr(int echoLength, StringBuilder charPoolMixed) {
        return RandomStringUtils.random(echoLength, charPoolMixed.toString());
    }

    /**  
     * @param args 
     * @see 
     */
    public static void main(String[] args) {
        System.out.println("4fccd361b226d6cee481dbb2def73d5835ed92e3".length());
        System.out.println("78004063".length());
        System.out.println("4923133352803794399".length());
    }

}
